Integrand size = 21, antiderivative size = 33 \[ \int \frac {\tan ^2(c+d x)}{(a+a \sec (c+d x))^2} \, dx=-\frac {x}{a^2}+\frac {2 \tan (c+d x)}{a d (a+a \sec (c+d x))} \]
[Out]
Time = 0.14 (sec) , antiderivative size = 35, normalized size of antiderivative = 1.06, number of steps used = 9, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.286, Rules used = {3973, 3971, 3554, 8, 2686, 3852} \[ \int \frac {\tan ^2(c+d x)}{(a+a \sec (c+d x))^2} \, dx=-\frac {2 \cot (c+d x)}{a^2 d}+\frac {2 \csc (c+d x)}{a^2 d}-\frac {x}{a^2} \]
[In]
[Out]
Rule 8
Rule 2686
Rule 3554
Rule 3852
Rule 3971
Rule 3973
Rubi steps \begin{align*} \text {integral}& = \frac {\int \cot ^2(c+d x) (-a+a \sec (c+d x))^2 \, dx}{a^4} \\ & = \frac {\int \left (a^2 \cot ^2(c+d x)-2 a^2 \cot (c+d x) \csc (c+d x)+a^2 \csc ^2(c+d x)\right ) \, dx}{a^4} \\ & = \frac {\int \cot ^2(c+d x) \, dx}{a^2}+\frac {\int \csc ^2(c+d x) \, dx}{a^2}-\frac {2 \int \cot (c+d x) \csc (c+d x) \, dx}{a^2} \\ & = -\frac {\cot (c+d x)}{a^2 d}-\frac {\int 1 \, dx}{a^2}-\frac {\text {Subst}(\int 1 \, dx,x,\cot (c+d x))}{a^2 d}+\frac {2 \text {Subst}(\int 1 \, dx,x,\csc (c+d x))}{a^2 d} \\ & = -\frac {x}{a^2}-\frac {2 \cot (c+d x)}{a^2 d}+\frac {2 \csc (c+d x)}{a^2 d} \\ \end{align*}
Time = 0.02 (sec) , antiderivative size = 42, normalized size of antiderivative = 1.27 \[ \int \frac {\tan ^2(c+d x)}{(a+a \sec (c+d x))^2} \, dx=\frac {-\frac {2 \arctan \left (\tan \left (\frac {c}{2}+\frac {d x}{2}\right )\right )}{d}+\frac {2 \tan \left (\frac {c}{2}+\frac {d x}{2}\right )}{d}}{a^2} \]
[In]
[Out]
Result contains complex when optimal does not.
Time = 0.62 (sec) , antiderivative size = 30, normalized size of antiderivative = 0.91
method | result | size |
risch | \(-\frac {x}{a^{2}}+\frac {4 i}{a^{2} d \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}\) | \(30\) |
derivativedivides | \(\frac {2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-2 \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a^{2} d}\) | \(31\) |
default | \(\frac {2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-2 \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a^{2} d}\) | \(31\) |
[In]
[Out]
none
Time = 0.28 (sec) , antiderivative size = 42, normalized size of antiderivative = 1.27 \[ \int \frac {\tan ^2(c+d x)}{(a+a \sec (c+d x))^2} \, dx=-\frac {d x \cos \left (d x + c\right ) + d x - 2 \, \sin \left (d x + c\right )}{a^{2} d \cos \left (d x + c\right ) + a^{2} d} \]
[In]
[Out]
\[ \int \frac {\tan ^2(c+d x)}{(a+a \sec (c+d x))^2} \, dx=\frac {\int \frac {\tan ^{2}{\left (c + d x \right )}}{\sec ^{2}{\left (c + d x \right )} + 2 \sec {\left (c + d x \right )} + 1}\, dx}{a^{2}} \]
[In]
[Out]
none
Time = 0.30 (sec) , antiderivative size = 49, normalized size of antiderivative = 1.48 \[ \int \frac {\tan ^2(c+d x)}{(a+a \sec (c+d x))^2} \, dx=-\frac {2 \, {\left (\frac {\arctan \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a^{2}} - \frac {\sin \left (d x + c\right )}{a^{2} {\left (\cos \left (d x + c\right ) + 1\right )}}\right )}}{d} \]
[In]
[Out]
none
Time = 0.51 (sec) , antiderivative size = 29, normalized size of antiderivative = 0.88 \[ \int \frac {\tan ^2(c+d x)}{(a+a \sec (c+d x))^2} \, dx=-\frac {\frac {d x + c}{a^{2}} - \frac {2 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{a^{2}}}{d} \]
[In]
[Out]
Time = 13.99 (sec) , antiderivative size = 22, normalized size of antiderivative = 0.67 \[ \int \frac {\tan ^2(c+d x)}{(a+a \sec (c+d x))^2} \, dx=\frac {2\,\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-\frac {d\,x}{2}\right )}{a^2\,d} \]
[In]
[Out]